package com.java.simple.study.jvm.memstruct.stack;

/**
 * @author zhoujl
 * @date 2022/5/23 21:04
 * @desc
 */
public class OperateStackTest {

    public void testAddOperation() {
        byte i = 15; // bipush istore_1
        int j = 8;   // bipush_8  istore_2
        int k = i + j;  // iload_1  iload_2 iadd istore_3
        int m = 8; // bipush 8 istore_4
        int z = 800; // sipush_800(s->short) istore_5
    }

    public int getSum() {
        int m = 10;
        int n = 20;
        int k = m + n;
        return k;  // ireturn
    }

    public void testGetSum() {
        //获取上一个栈帧返回的结果 并保存在操作数栈中
        int i = getSum();
        int j = 100;
    }

}
